package com.flying.invest.discovery.model;

import java.util.Date;

import com.flying.common.util.Codes;
import com.flying.framework.data.Data;
import com.flying.framework.annotation.ConstantEnum;
import com.flying.framework.annotation.Param;
import com.flying.framework.data.DataSerializable;
import com.flying.framework.metadata.Meta;

@SuppressWarnings("serial")
@Meta(id="i_discovery_opportunity",title="投资机会", table="i_discovery_opportunity", primaryKeys={"opportunity_id"})
public class DiscoveryOpportunity extends Data implements DataSerializable {
	public final static String ENTITY_NAME = "i_discovery_opportunity";
	
	public final static String OPPORTUNITY_ID = "opportunity_id";
	public final static String USER_ID = "user_id";
	public final static String DISCOVERY_ID = "discovery_id";
	public final static String ASSETS_ID = "assets_id";
	public final static String INVEST_ID = "invest_id";
	public final static String SUGGESTION_ID = "suggestion_id";
	public final static String NAME = "name";
	public final static String REMARKS = "remarks";
	public final static String STATUS = "status";
	public final static String PRICE = "price";
	public final static String QUANTITY = "quantity";
	public final static String TRANSACTION_TYPE = "transaction_type";
	public final static String TRANSACTION_DATE = "transaction_date";
	public final static String TRANSACTION_ID = "transaction_id";
	public final static String CREATOR = "creator";
	public final static String CREATE_TIME = "create_time";
	public final static String UPDATOR = "updator";
	public final static String UPDATE_TIME = "update_time";
	
	public enum Status implements ConstantEnum<Integer> {
		PREPARING(0, "待处理"), INVESTED(1, "已投资"), SUGGESTED(2, "已建议"), TRANSACTED(3, "已交易"), CANCELED(4, "已取消");

		public final int value;
		public final String remarks;

		Status(int value, String remarks) {
			this.value = value;
			this.remarks = remarks;
		}
		
		@Override
		public Integer value() {
			return this.value;
		}

		@Override
		public String text() {
			return remarks;
		}
	}
	
	
	@Param(value=OPPORTUNITY_ID, required=true, desc="机会ID" , generator=Codes.AUTO_INCREMENT)
	private Long opportunityId;
	
	@Param(value=USER_ID, required=true, desc="所属用户" )
	private Long userId;
	
	@Param(value=DISCOVERY_ID, required=true, desc="发现定义" )
	private Long discoveryId;
	
	@Param(value=ASSETS_ID, required=true, desc="投资品种ID" )
	private Long assetsId;
	
	@Param(value=INVEST_ID, required=false, desc="投资项目" )
	private Long investId;
	
	@Param(value=SUGGESTION_ID, required=false, desc="建议ID" )
	private Long suggestionId;
	
	@Param(value=NAME, required=false, maxlength=50, desc="名称" )
	private String name;
	
	@Param(value=REMARKS, required=false, maxlength=400, desc="说明" )
	private String remarks;
	
	@Param(value=STATUS, required=false, desc="状态（0：待处理；1：已投资；2：已建议；3：已交易；4：已取消）" )
	private Integer status;
	
	@Param(value=PRICE, required=true, desc="价格" )
	private Double price;
	
	@Param(value=QUANTITY, required=false, desc="交易数量" )
	private Double quantity;
	
	@Param(value=TRANSACTION_TYPE, required=true, desc="交易类型（1：买入；-1：卖出）" )
	private Integer transactionType;
	
	@Param(value=TRANSACTION_DATE, required=false, desc="交易日期" )
	private Date transactionDate;
	
	@Param(value=TRANSACTION_ID, required=false, desc="交易ID" )
	private Long transactionId;
	
	@Param(value=CREATOR, required=false, maxlength=40, desc="创建人" )
	private String creator;
	
	@Param(value=CREATE_TIME, required=false, desc="创建时间" )
	private Date createTime;
	
	@Param(value=UPDATOR, required=false, maxlength=40, desc="修改人" )
	private String updator;
	
	@Param(value=UPDATE_TIME, required=false, desc="修改时间" )
	private Date updateTime;
	
	
	public Long getOpportunityId() {
		return this.opportunityId;
	}
	
	public void setOpportunityId(Long opportunityId) {
		this.opportunityId = opportunityId;
	}
	
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	public Long getDiscoveryId() {
		return this.discoveryId;
	}
	
	public void setDiscoveryId(Long discoveryId) {
		this.discoveryId = discoveryId;
	}
	
	public Long getAssetsId() {
		return this.assetsId;
	}
	
	public void setAssetsId(Long assetsId) {
		this.assetsId = assetsId;
	}
	
	public Long getInvestId() {
		return this.investId;
	}
	
	public void setInvestId(Long investId) {
		this.investId = investId;
	}
	
	public Long getSuggestionId() {
		return this.suggestionId;
	}
	
	public void setSuggestionId(Long suggestionId) {
		this.suggestionId = suggestionId;
	}
	
	public String getName() {
		return this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getRemarks() {
		return this.remarks;
	}
	
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	public Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	public Double getPrice() {
		return this.price;
	}
	
	public void setPrice(Double price) {
		this.price = price;
	}
	
	public Double getQuantity() {
		return this.quantity;
	}
	
	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}
	
	public Integer getTransactionType() {
		return this.transactionType;
	}
	
	public void setTransactionType(Integer transactionType) {
		this.transactionType = transactionType;
	}
	
	public Date getTransactionDate() {
		return this.transactionDate;
	}
	
	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}
	
	public Long getTransactionId() {
		return this.transactionId;
	}
	
	public void setTransactionId(Long transactionId) {
		this.transactionId = transactionId;
	}
	
	public String getCreator() {
		return this.creator;
	}
	
	public void setCreator(String creator) {
		this.creator = creator;
	}
	
	public Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getUpdator() {
		return this.updator;
	}
	
	public void setUpdator(String updator) {
		this.updator = updator;
	}
	
	public Date getUpdateTime() {
		return this.updateTime;
	}
	
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	

}